
var express=require('express')
var dbs = require('mongodb').MongoClient;
var assert = require('assert');
var bodyParser = require('body-parser')
var commenFunc=require('./src/server/commen.js')
var index=require('./routes/index.js')//主页
var account=require('./routes/account/account.js');//账号登录，修改密码验证
var upload=require('./routes/uploadPic/uploadPic.js');//上传图片功能
var app=express()

//app.all('*', function(req, res, next) {
//  res.header("Access-Control-Allow-Origin", "*");
//  res.header("Access-Control-Allow-Headers", "X-Requested-With");
//  res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
//  res.header("X-Powered-By", ' 3.2.1');
//  res.header("Content-Type", "application/json;charset=utf-8");
//  next();
//});
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(express.static(__dirname + '/images'));  
app.use('/apis/accout',account)
app.use('/apis/uploadPic',upload)
app.listen(8888)



